const mongoose = require('mongoose')
const Auth = mongoose.model('role')

class Validate {
  async createRole(name, code, sex, nickName) {
    if(!name) return {status: 0, msg: '请输入角色名！'}
    if(!code) return {status: 0, msg: '请输入角色代码！'}
    let role = await Auth.findOne({code})
    if(role) return {status: 0, msg: '角色已存在！'}
  } 
}

module.exports = new Validate()